<!-- Phan khai bao bien cuc bo-->
<?php
include "../../4s/config/record/handle/config.php";
$v_limit_row = _CONST_NUMBER_OF_ROW_PER_LIST;
if(isset($_REQUEST['hdn_record_number_page'])){
	$v_limit_row = $_REQUEST['hdn_record_number_page'];
}
if(isset($_REQUEST['hdn_worktype'])) {
	$v_worktype = $_REQUEST['hdn_worktype'];
}else{
	$v_worktype = "";
}

//Xac dinh xem can bo thu ly co ky duyet thay Lanh dao khong
if(isset($_REQUEST['hdn_approve_by_handler'])) {
	$v_approve_by_handler = true;
}else{
	$v_approve_by_handler = false;
}

//Bien cho phep an/hien option "Chuyen co quan co tham quyen giai quyet" va "Trinh lanh dao ky giay phep"
$v_tranfered = 0;
$v_num = '';
$v_dem = -1;
if(isset($_REQUEST['hdn_tranfered'])){
	$v_tranfered = $_REQUEST['hdn_tranfered'];
}
//echo 'v_tranfered' . $v_tranfered . '<br>';

$v_recordtype_filter = $_SESSION['onegate_current_recordtype'];
$v_staff_id = $_SESSION['staff_id'];
$v_current_status = ($arr_single_record['C_CURRENT_STATUS']);
$v_detail_status = intval($arr_single_record['C_DETAIL_STATUS']);

//---BEGIN--NIEUVV--080808---lay trinh trang va detail status cua ho so khi tra ve tiep tuc thu ly---
$v_current_status_nieuvv = ($arr_all_record[0][17]);	// cot current_status
$v_detail_status_nieuvv = intval($arr_all_record[0][16]);// cot detail_status
//---THE--END--NIEUVV--080808-----------------------------------------------------------------------

#echo 'v_detail_status' . $v_detail_status . '<br>';
$v_recordtype_name = Get_text_from_array($_SESSION['recordtype'],'PK_RECORDTYPE','PK_RECORDTYPE','C_NAME',$v_recordtype_filter);
$v_record_code_list='';
$v_handler_id ='';
$v_update_status = true;	// DinhNQ Added 10-07-2007
for($row_index = 0;$row_index< $v_count;$row_index++){
	if ($row_index<$v_count-1)
		$v_record_code_list = $v_record_code_list.$arr_all_record[$row_index][0].", ";
	else
		$v_record_code_list = $v_record_code_list.$arr_all_record[$row_index][0];
		$v_handler_id = intval($arr_all_record[$row_index][4]);	// capture FK_HANDLER
//echo 'aaaaa'.$v_handler_id;
	//---------- Update by Dinh, Nguyen ---------
	//--- Date: 10/07/2007 ----------------------
	// Content: Click lom chom ------------------
	/* Kiem tra xem co quyen cap nhat trang thai ket quan thu ly khong? */
	//echo "staff_id: ", $v_staff_id, " --- handler_id: ", $v_handler_id;
	if($v_staff_id != $v_handler_id)
		$v_update_status = false;

}
// xac dinh label hien thi: trinh ky, duoc giai quyet, khong duoc giai quyet
$arr_result_label = onegate_get_label_of_result_type($_SESSION['recordtype'],$v_recordtype_filter);

$v_work_date = date("d/m/Y");
?>
<!--bang chua tieu de cua form-->
<table width="100%" cellpadding="0" cellspacing="0">
	<tr class="large_title">
		<td><?php 
			if ($v_approve_by_handler) {
				echo CONST_UPDATE_APPROVE_RECORD_TITLE;
			}else
				echo CONST_UPDATE_STATUS_RECORD_TITLE;
			?></td>
	</tr>
</table>
<!-- Bat cac phim: F12=true; Insert=false; Delete=false, ESC=true; Enter=true -->
<div id="hotkey" onKeyDown="javascript:process_hot_key(true,false,false,true,true);">
<!--bang chua cac text box de nhap du lieu-->
<table width="100%" class="form_table1" cellpadding="0" cellspacing="0">
	<col width="20%"><col width="60%"><col width="20%">
	<tr>
		<form action="index.php" method="post" name="f_record_update_status">
		<input type="hidden" name="fuseaction" value="" >
		<!--bien hidden xac dinh can bo thu ly co ky duyet thay Lanh dao khong -->
		<input type="hidden" name="hdn_approve_by_handler" value="<?php echo $v_approve_by_handler?>" >
		<input type="hidden" name="hdn_record_id_list" value="<?php echo $v_record_id_list ?>" >
		<input type="hidden" name="hdn_recordtype_filter" value="<?php echo $v_recordtype_filter;?>">
		<input type="hidden" name="hdn_work" value="">
		<!-- Leav_17102008-->
		<input type="hidden" name="hdn_record_number_page" value="<?php echo $v_limit_row;?>">
		<!-- Leav_17102008_end-->
	</tr>
	<tr>
	<tr>
		<td class="normal_label"><?php echo CONST_RECORD_TYPE_LABEL; ?></td>
		<td><?php echo $v_recordtype_name;?></td>
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_LIST_RECORD_LABEL; ?></td>
		<td><?php echo $v_record_code_list;?></td>
	</tr><tr>
		<td class="normal_label"><?php echo _CONST_WORK_DATE_LABEL?></td>
		<td>
			<input class="normal_date_textbox" name="txt_work_date" type="text" value="<?php echo $v_work_date; ?>" optional="true" isdate="true" message="<?php echo _CONST_WORK_DATE_MESSAGE;?>" onKeyDown="change_focus(document.forms[0],this)" readonly>
			<!-- img src="<?php echo $_ISA_IMAGE_URL_PATH;?>calendar.gif" border="0" onclick="DoCal('<?php echo $_ISA_LIB_URL_PATH;?>isa-calendar/',document.forms[0].txt_work_date);" style="cursor:hand" -->
		</td>
	</tr>
	<tr class="normal_label">
		<td class="normal_label"><?php echo CONST_RESULT_HANDLE_RECORD_LABEL; ?></td>
		<td></td>
	</tr>	
	<?php
	if (onegate_is_tranfer_to_senior_for_recordtype($v_staff_id,$v_recordtype_filter,$_SESSION["recordtype"]) 
		&& onegate_is_handler_for_recordtype($v_staff_id,$v_recordtype_filter,$_SESSION["recordtype"]) && $v_detail_status != 70
		&& $v_tranfered == 0){?>
		<tr class="normal_label">
			<td height="37"></td>
			<td><input type="radio" name="rad_status" value="CHUYEN_HOSO_CQTQ" onclick="refuse_onclick_KQTL(this,document.forms[0].hdn_work);" optional="true"><?php echo $arr_result_label[7];$v_dem++; ?></td>
		</tr><?php
	}
	 //echo 'trans='.$v_tranfered.',,,'.$v_detail_status;
	if(($v_tranfered == 0) && (($v_detail_status != 70))){ 
		if (onegate_is_submit_to_leader_for_recordtype($v_staff_id,$v_recordtype_filter,$_SESSION["recordtype"])
			&& onegate_is_handler_for_recordtype($v_staff_id,$v_recordtype_filter,$_SESSION["recordtype"])){
				$p_arr_all_recordtype = $_SESSION["recordtype"];				
				if ($v_recordtype_filter !=""){
					for($i=0; $i< sizeof($p_arr_all_recordtype); $i++){
						if ($p_arr_all_recordtype[$i]['PK_RECORDTYPE'] == $v_recordtype_filter ){
							$v_handle_leader_first_time_list = $p_arr_all_recordtype[$i]['FK_HANDLE_LEADER_FIRST_TIME'];
							$v_arr_handle_leader_first_time_list = explode(",", $v_handle_leader_first_time_list);
							//vunh them vao de hien thi chi cac can bo la lanh dao cung phong voi can bo thu ly
							$v_arr_handle_leader_first_time_list_temp = $v_arr_handle_leader_first_time_list;
							$v_arr_handle_leader_first_time_list = array();
							for ($i = 0; $i < sizeof($v_arr_handle_leader_first_time_list_temp); $i++) {
								if (_get_item_attr_by_id($_SESSION['arr_all_staff'], $_SESSION['staff_id'], 'unit_id') == _get_item_attr_by_id($_SESSION['arr_all_staff'], $v_arr_handle_leader_first_time_list_temp[$i], 'unit_id')) {
									$v_arr_handle_leader_first_time_list[] = $v_arr_handle_leader_first_time_list_temp[$i];
								}
							}
							//end vunh added
							$v_handle_leader_list = $p_arr_all_recordtype[$i]['FK_HANDLE_LEADER'];
							$v_arr_handle_leader_list = explode(",", $v_handle_leader_list);
							//vunh them vao de hien thi chi cac can bo la lanh dao cung phong voi can bo thu ly
							$v_arr_handle_leader_list_temp = $v_arr_handle_leader_list;
							$v_arr_handle_leader_list = array();
							for ($i = 0; $i < sizeof($v_arr_handle_leader_list_temp); $i++) {
								if (_get_item_attr_by_id($_SESSION['arr_all_staff'], $_SESSION['staff_id'], 'unit_id') == _get_item_attr_by_id($_SESSION['arr_all_staff'], $v_arr_handle_leader_list_temp[$i], 'unit_id')) {
									$v_arr_handle_leader_list_list[] = $v_arr_handle_leader_list_temp[$i];
								}
							}
							//end vunh added
							//echo $i;
							//var_dump($v_handle_leader_list);exit;
							break;
						}
					}
				}				
				//var_dump($v_arr_handle_leader_list);exit;
				$sz_arr_handle_leader_first_time_list = sizeof($v_arr_handle_leader_first_time_list);
				$sz_arr_handle_leader_list = sizeof($v_arr_handle_leader_list);			
				
				//echo 'Tong so lanh dao:'.$sz_arr_handle_leader_list;
				//nieuvv--111108--hien thi radio tuong ung voi cong viec dac biet								
				for($j = 0 ; $j < $v_cout; $j ++)
				{
					for($i = 0 ; $i < $v_count_spec_worktype ; $i ++)
					{											
						if($arr_all_spec_worktype[$i]['C_UPDATE_METHOD_START'] == 'HANDLE_RESULT_UPDATE'&& $arr_all_spec_worktype[$i]['FK_WORKTYPE_START'] == $arr_list[$j][0])
						{
							$v_name_spec_worktype = _getname($arr_list,$arr_all_spec_worktype[$i]['FK_WORKTYPE_START']);
						?>
						<tr class="normal_label">
						<td height="37"></td>		
						<td><input type="radio" name="rad_status" value="<?php echo $arr_all_spec_worktype[$i]['PK_SPEC_WORKTYPE'].",".$arr_all_spec_worktype[$i]['FK_WORKTYPE_START'].",SPEC"; ?>" onclick="refuse_onclick_KQTL(this,document.forms[0].hdn_work);" optional="true"><?php echo $v_name_spec_worktype;$v_dem++;?></td>
					</tr>	
						<?php 
						}
					}
				}
				// the-end-nieuvv-111108---
				if ($sz_arr_handle_leader_first_time_list == $sz_arr_handle_leader_list && $sz_arr_handle_leader_list == 1) {
					
					if (_get_item_attr_by_id($_SESSION['arr_all_staff'], $v_arr_handle_leader_list[0], 'id') == _get_item_attr_by_id($_SESSION['arr_all_staff'], $v_arr_handle_leader_first_time_list[0], 'id')) {

					$v_leader_name = "<b><font color='#0099FF'>" . _get_item_attr_by_id($_SESSION['arr_all_staff'], $v_arr_handle_leader_list[0], 'name') . "</font></b>";
					
				?>
					<tr class="normal_label">
						<td height="37"></td>		
						<td><input type="radio" name="rad_status" value="<?php echo 'TRINH_LD_PHONG,'.$v_arr_handle_leader_list[0]; ?>" onclick="refuse_onclick_KQTL(this,document.forms[0].hdn_work);" optional="true"><?php echo "Tr&igrave;nh l&atilde;nh &#273;&#7841;o&nbsp;".$v_leader_name; $v_dem++; ?></td>
					</tr>				
		   <?php }
		   		//--BEGIN--NIEUVV--080808----TRINH LANH DAO PHE DUYET LAI----
				else {
		   			if($v_current_status_nieuvv == "DANG_THU_LY" && $v_detail_status_nieuvv == 31){ 
				$v_leader_name = "<b><font color='#0099FF'>" . _get_item_attr_by_id($_SESSION['arr_all_staff'], $v_arr_handle_leader_first_time_list[0], 'name') . "</font></b>";
				?>
						<tr class="normal_label">
						<td height="37"></td>		
						<td><input type="radio" name="rad_status" value="<?php echo 'TRINH_LD_PHONG_LAN_SAU,'.$v_arr_handle_leader_first_time_list[0]; ?>" onclick="refuse_onclick_KQTL(this,document.forms[0].hdn_work);" optional="true"><?php echo "Tr&igrave;nh l&atilde;nh &#273;&#7841;o&nbsp;".$v_leader_name; $v_dem++; ?></td>
					</tr>
				<?php }			
			//--THE--END--NIEUVV--080808-------------------
					else {
					$v_leader_name = "<b><font color='#0099FF'>" . _get_item_attr_by_id($_SESSION['arr_all_staff'], $v_arr_handle_leader_first_time_list[0], 'name') . "</font></b>";
					
	?>
	<tr class="normal_label">
						<td height="37"></td>		
						<td><input type="radio" name="rad_status" value="<?php echo 'TRINH_LD_PHONG_LAN_DAU,'.$v_arr_handle_leader_first_time_list[0]; ?>" onclick="refuse_onclick_KQTL(this,document.forms[0].hdn_work);" optional="true"><?php echo "Tr&igrave;nh l&atilde;nh &#273;&#7841;o&nbsp;".$v_leader_name; $v_dem++; ?></td>
					</tr>				
		   <?php	}
				}
				}
				else if ($sz_arr_handle_leader_list == 1) {
					for($i = 0; $i < $sz_arr_handle_leader_first_time_list; $i++) {
						$v_leader_name = "<b><font color='#0099FF'>" . _get_item_attr_by_id($_SESSION['arr_all_staff'], $v_arr_handle_leader_first_time_list[$i], 'name') . "</font></b>";
						//echo 'Ten lanh dao:'.$v_leader_name;
						if (in_array($v_arr_handle_leader_first_time_list[$i], $v_arr_handle_leader_list)) { 							
							?>
							<tr class="normal_label">
								<td height="37"></td>		
								<td><input type="radio" name="rad_status" value="<?php echo 'TRINH_LD_PHONG,'.$v_arr_handle_leader_first_time_list[$i]; ?>" onclick="refuse_onclick_KQTL(this,document.forms[0].hdn_work);" optional="true"><?php echo "Tr&igrave;nh l&atilde;nh &#273;&#7841;o&nbsp;".$v_leader_name; $v_dem++; ?></td>
							</tr>										
				   <?php }
				   //--BEGIN--NIEUVV--080808----TRINH LANH DAO PHE DUYET LAI----
				
		   		if($v_current_status_nieuvv == "DANG_THU_LY" && $v_detail_status_nieuvv == 31){ 
				$v_leader_name = "<b><font color='#0099FF'>" . _get_item_attr_by_id($_SESSION['arr_all_staff'], $v_arr_handle_leader_first_time_list[$i], 'name') . "</font></b>";
				?>
						<tr class="normal_label">
						<td height="37"></td>		
						<td><input type="radio" name="rad_status" value="<?php echo 'TRINH_LD_PHONG_LAN_SAU,'.$v_arr_handle_leader_first_time_list[$i]; ?>" onclick="refuse_onclick_KQTL(this,document.forms[0].hdn_work);" optional="true"><?php echo "Tr&igrave;nh l&atilde;nh &#273;&#7841;o&nbsp;".$v_leader_name; $v_dem++; ?></td>
					</tr>
				<?php }			
			//--THE--END--NIEUVV--080808-------------------
						 else { 
						 //echo 'Ten lanh dao:'.$v_leader_name;
						 if (in_array($v_arr_handle_leader_first_time_list[$i], $v_arr_handle_leader_list)!= true){
						 ?>
						 
							<tr class="normal_label">
								<td height="37"></td>		
								<td><input type="radio" name="rad_status" value="<?php echo 'TRINH_LD_PHONG_LAN_DAU,'.$v_arr_handle_leader_first_time_list[$i]; ?>" onclick="refuse_onclick_KQTL(this,document.forms[0].hdn_work);" optional="true"><?php echo "Tr&igrave;nh l&atilde;nh &#273;&#7841;o&nbsp;".$v_leader_name; $v_dem++; ?></td>
							</tr>	
				   <?php } }
					}
				}
				else{
					for($i = 0; $i < $sz_arr_handle_leader_first_time_list; $i++) {
					//--BEGIN--NIEUVV--080808----TRINH LANH DAO PHE DUYET LAI----
		   				if($v_current_status_nieuvv == "DANG_THU_LY" && $v_detail_status_nieuvv == 31){ 
							$v_leader_name = "<b><font color='#0099FF'>" . _get_item_attr_by_id($_SESSION['arr_all_staff'], $v_arr_handle_leader_first_time_list[$i], 'name') . "</font></b>";
				   ?>
						<tr class="normal_label">
						<td height="37"></td>		
						<td><input type="radio" name="rad_status" value="<?php echo 'TRINH_LD_PHONG_LAN_SAU,'.$v_arr_handle_leader_first_time_list[$i]; ?>" onclick="refuse_onclick_KQTL(this,document.forms[0].hdn_work);" optional="true"><?php echo "Tr&igrave;nh l&atilde;nh &#273;&#7841;o&nbsp;".$v_leader_name; $v_dem++; ?></td>
					</tr>
					<?php }	else{ 
			//--THE--END--NIEUVV--080808-------------------
						$v_leader_name = "<b><font color='#0099FF'>" . _get_item_attr_by_id($_SESSION['arr_all_staff'], $v_arr_handle_leader_first_time_list[$i], 'name') . "</font></b>";?>
						<tr class="normal_label">
							<td height="37"></td>		
							<td><input type="radio" name="rad_status" value="<?php echo 'TRINH_LD_PHONG_LAN_DAU,'.$v_arr_handle_leader_first_time_list[$i]; ?>" onclick="refuse_onclick_KQTL(this,document.forms[0].hdn_work);" optional="true"><?php echo "Tr&igrave;nh l&atilde;nh &#273;&#7841;o&nbsp;".$v_leader_name; $v_dem++; ?></td>
						</tr>	
			  	<?php }
				}			
		}
		}
	}?>
	
	<?php //---------------------------------------------------------------------------------------------------02102008
	if($v_current_status_nieuvv=='DANG_THU_LY' && ($v_detail_status_nieuvv==24 || $v_detail_status_nieuvv==25)){ 
	if ($v_recordtype_filter !=""){ 
		$p_arr_all_recordtype = $_SESSION["recordtype"];
		for($i=0; $i< sizeof($p_arr_all_recordtype); $i++){
			if ($p_arr_all_recordtype[$i]['PK_RECORDTYPE'] == $v_recordtype_filter ){
				$v_handle_leader_first_time_list = $p_arr_all_recordtype[$i]['FK_HANDLE_LEADER_FIRST_TIME'];
				$v_arr_handle_leader_first_time_list = explode(",", $v_handle_leader_first_time_list);
				break;
			}
		}
	}				
		for($i = 0; $i < sizeof($v_arr_handle_leader_first_time_list); $i++) { 
				$v_leader_name = "<b><font color='#0099FF'>" . _get_item_attr_by_id($_SESSION['arr_all_staff'], 		$v_arr_handle_leader_first_time_list[$i], 'name') . "</font></b>";
	?>
		<tr class="normal_label">
				<td height="37"></td>		
				<td><input type="radio" name="rad_status" value="<?php echo 'TRINH_LD_PHONG_LAN_DAU,'.$v_arr_handle_leader_first_time_list[$i]; ?>" onclick="refuse_onclick_KQTL(this,document.forms[0].hdn_work);" optional="true"><?php echo "Tr&igrave;nh l&atilde;nh &#273;&#7841;o&nbsp;".$v_leader_name; $v_dem++; ?></td>
		</tr>	
	
	<?php }
	}//-------------------------------------------------------------------------------------------------------------------02102008?> 

	<?php //---------HieuDT 29/10/2008 (bo radio duoc cap phep va tu choi cap phep thuoc VP.DKQSDDat va TNMT)---------
	
		$kq_tl = VPDKQSDDVATNMT;
		$is = false;
			//kiem tra phong ban
			$v_recordtype_filter = $_SESSION['onegate_current_recordtype'];//Lay loai thu tuc
			$arr_staff = get_arr_staff($fk_handler_agency);
			$_arr_unit_code =  explode(",",$kq_tl); //ham cat chuoi luu vao mang $_arr_unit_code 
			$j = 0;	
			$arr_unit_id = array();			
			foreach($_SESSION['arr_all_unit'] as $v_unit)
			{
				for($i = 0 ; $i < sizeof($_arr_unit_code) ; $i ++)
				{
					if($v_unit['code'] == $_arr_unit_code[$i])
					{
						$arr_unit_id[$j] = $v_unit['id'] ;
						$j ++;
					}						
				}
			}
			
			//tim phong ban thu ly
			
			for($i = 0 ; $i < sizeof ($arr_all_recordtype) && $is == false; $i++ )	
			{
				if($arr_all_recordtype[$i][0] == $v_recordtype_filter)		
				{
			    	$fk_handler_agency = $arr_all_recordtype[$i][11];
					$is= true;
				}		
			}
			
			$v_size_unit = sizeof($arr_unit_id);
			$is = false;
			if ($v_size_unit >=1)
			{
				for ($i = 0; $i <$v_size_unit &&$is == false ; $i ++)
				{
					if($fk_handler_agency == $arr_unit_id[$i])
					     $is = true;
				}
			}
	
		if ( $is != true)
		{?>
		<tr class="normal_label">
		<td class="normal_label"></td>
		<td><input type="radio" name="rad_status" value="LD_PHONG_CAPPHEP" onclick="refuse_onclick_KQTL(this,document.forms[0].hdn_work);" optional="true"><?php echo $arr_result_label[1];$v_dem++; ?></td>
	</tr>
	<tr class="normal_label">
		<td height="37"></td>
		<td><input type="radio" name="rad_status" value="LD_PHONG_TUCHOI" onclick="refuse_onclick_KQTL(this,document.forms[0].hdn_work);set_value_for_obj(document.forms[0].txt_reason,'<?php echo $v_reason;?>')" optional="true"><?php echo $arr_result_label[2]; $v_dem++; if($v_num!='') $v_num = $v_num.','.$v_dem; else $v_num = $v_dem;?></td>
	</tr>
		<?php } //---------End HieuDT 29/10/2008 (bo radio duoc cap phep va tu choi cap phep thuoc VP.DKQSDDat va TNMT)---------
	?>
	<?php ?>
	<tr id="tr_reason" clas s="normal_label" style="display:none">
		<td height="37"><?php echo CONST_RECORD_REASON_LABEL; ?></td>
		<td><textarea name="txt_reason" class="normal_textarea" value="" row="4" style="width:100%" optional="true" message=""></textarea></td>
	</tr>
</table>
<!--bang chua cac button-->
<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr><td>&nbsp;</td></tr>
	<tr align="center">
		<td><?php
			if (($v_is_granted_update)||onegate_is_handler_for_recordtype($v_staff_id,$v_recordtype_filter,$_SESSION["recordtype"])){?>
				<?php if($v_update_status){?>
				<!------------begin hieudt 081208 ---------------------->
					<input type="button" name="btn_save"  class="normal_button" value="<?php echo _CONST_SAVE_BUTTON;?>" onClick="
					<?php if($v_current_status_nieuvv=='DANG_THU_LY')
					 {?>						if(test_status_update(document.forms[0].rad_status,document.forms[0].txt_reason,'<?=$v_num?>')){Update_record_status('UPDATE_RECORD_STATUS');}
					 <?php 
					 }
					 else
					 {
						 if ($v_ma==$v_handler_id)
						 {?>							if(test_status_update(document.forms[0].rad_status,document.forms[0].txt_reason,'<?=$v_num?>')){Update_record_status('UPDATE_RECORD_STATUS');}
					  <?php 
						 }
						 else
						 {?> 
							alert('Không được phép cập nhật vì cán bộ đang duyệt');
							return;
						 <?php 
						 }					 
					 }?>
					" onKeyDown="change_focus(document.forms[0],this)"><?php
				}
			}?><!------------end hieudt 081208 ---------------------->
			<?php if($v_current_status_nieuvv=='DANG_THU_LY'&& ($v_detail_status_nieuvv==24||$v_detail_status_nieuvv==25)){ ?>
				<input type="button" name="btn_back" class="normal_button" value="<?php echo _CONST_BACK_BUTTON;?>" onClick="btn_back_onclick('<?php echo $_GO_BACK?>')" onKeyDown="change_focus(document.forms(0),this)">
			<?php } else{?>
			<input type="button" name="btn_back" class="normal_button" value="<?php echo _CONST_BACK_BUTTON;?>" onClick="javascript:window.location='<?php echo $_URL_BACK; ?>'" onKeyDown="change_focus(document.forms[0],this)">
			<?php }?>
			
		</td>
	</tr>
</table>					
</div>
</form>
<script language="JavaScript">
set_focus(document.forms[0]);

</script>
<?php 
//Kiem tra danh sach can bo phe duyet ho so lan 1 co trung voi danh sach can bo phe duyet lan 2 khong
function first_time_handle_leaders_is_handle_leaders($arr_handle_leader_first_time_list, $arr_handle_leader_list) {
	$sz_arr_handle_leader_first_time_list = sizeof($arr_handle_leader_first_time_list);
	$sz_arr_handle_leader_list = sizeof($arr_handle_leader_list);
	if ($sz_arr_handle_leader_first_time_list == $sz_arr_handle_leader_list && $sz_arr_handle_leader_list == 1) {
		if ($arr_handle_leader_first_time_list[0] == $arr_handle_leader_list[0]) {
			return true;
		}
	}
	if ($sz_arr_handle_leader_list == 1) {
		return in_array($arr_handle_leader_list[0], $arr_handle_leader_first_time_list);				
	}
	return false;
}
?>